package ControlLayer;
import ModelLayer.Supplier;
import DBLayer.DBSupplier;
import java.util.ArrayList;

public class CtrSupplier {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrSupplier instance = null;
    DBSupplier dbSupplier = new DBSupplier();

    public CtrSupplier() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrSupplier getInstance() {
        if (instance == null) {
            instance = new CtrSupplier();
        }
        return instance;
    }

    public ArrayList<Supplier> getSupplierList() {
        return dbSupplier.getSupplierList();
    }

    public Supplier getSupplierByID(int id) {
        return dbSupplier.getSupplierByID(id);
    }

    public int addSupplier(Supplier supplier) {
        return dbSupplier.addSupplier(supplier);
    }

    public int updateSupplier(Supplier supplier, int id) {
        return dbSupplier.updateSupplier(supplier, id);
    }

    public void deleteSupplier(int id) {
        dbSupplier.deleteSupplier(id);
    }
    // </editor-fold>
}
